<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php
    if (empty(Yii::app()->params['app']['mid'])){?>
    <!-- 
    <div class="update-nag">
    <a href="<?php echo Yii::app()->params['app']['host']?>/index.php?r=adminSettingPanel/index"><input onclick="window.location.href='<?php echo Yii::app()->params['app']['host']?>/index.php?r=adminSettingPanel/index'" class="Miniyun_Setup_midbtn1" onmouseover="this.className='Miniyun_Setup_midbtn1hover'" onmouseout="this.className='Miniyun_Setup_midbtn1'"></a>
    <span>您就可DIY Windows、Android、iPhone/iPad云盘了</span>
    </div>
     -->
<?php }?>
<?php $this->pageTitle="控制面板"; ?>
<script type="text/javascript">
<!--
function  ForDight(Dight,How)
{
   Dight  =  Math.round  (Dight*Math.pow(10,How))/Math.pow(10,How);
   return  Dight;
}
//-->
</script>
<div id="icon-index" class="icon32">
	<br />
</div>
		
<h2>控制面板</h2>
<br>
<div id="dashboard_right_now" class="postbox ">
	<h3 class='hndle'>
		软件版本
	</h3>
	<span id='Miniyun-version-message'>您正在使用<?php echo Yii::app()->params['app']['name'];?> V<?php echo Yii::app()->params['app']['version'];?>。</span>
</div> 

<?php 
$post_max_size = CUtils::return_bytes(ini_get('post_max_size'));
$upload_max_filesize = CUtils::return_bytes(ini_get('upload_max_filesize'));
$defalt = 20 * 1024 * 1024; $size = ($post_max_size > $upload_max_filesize) ? ini_get('upload_max_filesize') : ini_get('post_max_size');
if ($post_max_size < $defalt || $upload_max_filesize < $defalt) {?>
<div id="dashboard_right_now" class="postbox ">
<h3 class='hndle'>系统提示</h3>
<span class="spam">上传文件尺寸：  <strong>小于 <?php echo $size;?>
</strong>，建议修改php.ini配置 （比如：upload_max_filesize = 8M post_max_size = 2M）</span>
</div>
<?php }?>

<?php if(count($model->detect)>0): ?>
<div id="dashboard_right_now" class="postbox ">
	<div class="handlediv" title="点击以切换">
		<br />
	</div>
	<h3 class='hndle'>
		<span>系统配置</span>
	</h3>
	<div class="inside">
		<?php if(isset($model->detect['hostError']) && $model->detect['hostError']): ?>
			<span class="spam"><strong>域名错误 :</strong></span>
			<span class="spam" id='Miniyun-version-message'>您的域名配置有误，请立即修正 <?php echo CHtml::link('前往',Yii::app()->createUrl('adminSettingPanel/index', array('error'=>1)))?></span><p>
    	<?php endif; ?>
		<?php if(isset($model->detect['gdError']) && $model->detect['gdError']): ?>
			<span class="waiting"><strong>GD库错误 :</strong></span>
			<span class="waiting" id='Miniyun-version-message' >您的PHP版本不支持GD库扩展。将影响：密码输入3次错误后，系统无法出现验证码 <?php echo CHtml::link('解决','http://www.google.com/#q=Php+FreeType+Support')?></span><p>
    	<?php endif; ?> 
	</div>
</div>
<?php endif; ?>

<div id="dashboard_right_now" class="postbox ">
	<div class="handlediv" title="点击以切换">
		<br />
	</div>
	<h3 class='hndle'>
		<span>基本</span>
	</h3>
	<div class="inside">

		<div class="table table_content">
			<p class="sub">文件</p>
			<table>
				<tr class="first">
					<td class="first b b-posts"><?php echo CHtml::link($fileModel->count(), Yii::app()->createUrl('adminFilePanel/index'), array('class'=>'total-count')); ?></td>
					<td class="t posts"><?php echo CHtml::link('文件与目录', Yii::app()->createUrl('adminFilePanel/index'), array('class'=>'approved')); ?></td>
				</tr>
				<tr>
					<td class="first b b_pages"><?php echo CHtml::link($fileModel->officeCount(), Yii::app()->createUrl('adminFilePanel/office&office=1')); ?></td>
					<td class="t pages"><?php echo CHtml::link('办公文档', Yii::app()->createUrl('adminFilePanel/office&office=1')); ?></td>
				</tr>
				<tr>
					<td class="first b b-cats"><?php echo CHtml::link($fileModel->imageCount(), Yii::app()->createUrl('adminFilePanel/image&image=1')); ?></td>
					<td class="t cats"><?php echo CHtml::link('图片', Yii::app()->createUrl('adminFilePanel/image&image=1'), array('class'=>'waiting')); ?></td>
				</tr>
				<tr>
					<td class="first b b-tags"><?php echo CHtml::link($fileModel->deletedCount(), Yii::app()->createUrl('adminFilePanel/trash&trash=1')); ?></td>
					<td class="t tags"><?php echo CHtml::link('回收站', Yii::app()->createUrl('adminFilePanel/trash&trash=1'), array('class'=>'spam')); ?></td>
				</tr>

			</table>
		</div>
		<div class="table table_discussion">
			<p class="sub">用户</p>
			<table>
			   <tr>
					<td class="b b-waiting"><?php echo CHtml::link($onlineDevice->getOnlineCount(), Yii::app()->createUrl('adminUserPanel/index&disabled=1')); ?></td>
					<td class="last t"><?php echo CHtml::link('在线用户', Yii::app()->createUrl('adminControlPanel/online'), array('class'=>'spam')); ?></td>
				</tr>
				<tr class="first">
					<td class="b b-comments"><?php echo CHtml::link($userModel->count(), Yii::app()->createUrl('adminUserPanel/index')); ?></td>
					<td class="last t comments"><?php echo CHtml::link('用户', Yii::app()->createUrl('adminUserPanel/index'), array('class'=>'approved')); ?></td>
				</tr>
				<tr>
					<td class="b b_approved"><?php echo CHtml::link($userModel->adminCount(), Yii::app()->createUrl('adminUserPanel/index&isAdmin=1')); ?></span></td>
					<td class="last t"><?php echo CHtml::link('管理员', Yii::app()->createUrl('adminUserPanel/index&isAdmin=1'), array('class'=>'waiting')); ?></td>
				</tr>
				<tr>
					<td class="b b-waiting"><?php echo CHtml::link($userModel->disabledCount(), Yii::app()->createUrl('adminUserPanel/index&disabled=1')); ?></td>
					<td class="last t"><?php echo CHtml::link('冻结的用户', Yii::app()->createUrl('adminUserPanel/index&disabled=1'), array('class'=>'spam')); ?></td>
				</tr>
			</table>
		</div>
		<div class="versions">
			<br class="clear" />
		</div>
	</div>
</div>
<div id="dashboard-widgets-wrap">

	<div id="dashboard-widgets" class="metabox-holder">
		<div class='postbox-container' style='width: 49%;'></div>
	</div>
	<div id="dashboard_right_now" class="postbox ">
		<div class="handlediv" title="点击以切换">
			<br />
		</div>
		<h3 class='hndle'>
			<span>空间使用情况</span>
		</h3>
		<div class="inside">
			<?php
					$this->Widget('ext.highcharts.HighchartsWidget', array(
                   'options'=>$model->chartPie(),
					));
					?>
			
		</div>
	</div>
</div>
<?php
?>

<div class='postbox-container' style='display: none; width: 49%;'>

	<div id="column3-sortables" class="meta-box-sortables"></div>
</div>
<div class='postbox-container' style='display: none; width: 49%;'>
	<div id="column4-sortables" class="meta-box-sortables"></div>
</div>

<form style="display: none" method="get" action="">
	<p>
		<input type="hidden" id="closedpostboxesnonce"
			name="closedpostboxesnonce" value="4605d5dc00" /><input type="hidden"
			id="meta-box-order-nonce" name="meta-box-order-nonce"
			value="d84f5f120a" />
	</p>
</form>


<div class="clear"></div>
<!-- dashboard-widgets-wrap -->

